package com.frxuexi.lib_base.room

import dagger.Module
import dagger.Provides
import dagger.hilt.InstallIn
import dagger.hilt.components.SingletonComponent
import javax.inject.Singleton

@Module
@InstallIn(SingletonComponent::class)
object DataProvider {

    @Singleton
    @Provides
    fun initDB():AppDataBase{
        return AppDataBase.init()
    }

    @Provides
    fun getUserDao(appDataBase: AppDataBase):UserDao{
        return appDataBase.userDao()
    }

    @Provides
    fun getleaveDao(appDataBase: AppDataBase):LeaveDao{
        return appDataBase.leaveDao()
    }
}